“inputs”: [],
“name”: “testForCovidPositivePublicExternal”,
“outputs”: [],
“stateMutability”: “nonpayable”,
“type”: “function”
}
]
Only the public and external functions are represented on ABI,
whereas the other two are not.
2.5.19.1 Event Logs in Solidity
We all know that Ethereum is a public blockchain where the
transactions are continuously stored in Blocks. Every transaction can
be associated with logs by invoking the Events where the custom
data can be stored in the Block and remain associated with the
contact’s address permanently. However, there are some limitations
for accessing the event data.
The logs associated with the events help in the integration with the
frontend code and even in the integration with the other contracts at
times.
An event can be declared using the event keyword. Refer to the
following example:
// SPDX-License-Identifier: SOME IDENTIFIER
pragma solidity ^0.8.10;
contract Covid19Testing {
uint numberOfPositivePatients;
event NewPositiveFound(address fromAddress, uint number); //
Event
function testForCovidPositive() public payable {
// if a new positive is found
emit NewPositiveFound(msg.sender,
++numberOfPositivePatients); // Triggering event
}